package cn.janescott.framework.core;

import cn.janescott.framework.core.utils.DateFormatUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author scott
 * @date 2019/2/13
 */
public class DateFormatTester {

    private static SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static void main(String[] args) {
        Date date = new Date();
        String dateStr = "2019-02-13 12:11:02";
        for (int i=0; i< 50; i++) {
            new Thread(() -> {
                try {
//                    System.out.println(DateFormatUtils.getInstance().parse(dateStr));
//                    System.out.println(DateFormatUtils.getInstance().format(date));
//                    System.out.println(Thread.currentThread().getName() + "------" +fmt.parse(dateStr));
                    System.out.println(Thread.currentThread().getName() + "------" +fmt.format(date));
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            }).start();
        }
    }

}
